capture log close
log using immigsocwelf_followup_rep, replace text
//program:  immigsocwelf_followup_rep.do
//task:    Replicating follow-up survey analyses
//project:  Social Welfare Attitudes and Immigrants as a Target Population: Experimental Evidence (Perspectives on Politics)
//author: Jake Haselswerdt \ 2020-6-4

//program setup
version 14
clear all
set linesize 80
macro drop _all
set scheme s1mono
set more off

use immigsocwef_followup.dta, clear

global controls "black hispanic otherrace male ideo01 pid7 agecat incomecat educ notbornus parents_notbornus sr2k"

//Table F.2 - Replication of Main Assumption Results 
logit benefit_immigonly i.treatgroup, robust
est sto simple
logit benefit_immigonly i.treatgroup##c.immigscale, robust
est sto immigscale
logit benefit_immigonly i.treatgroup##c.immigscale $controls, robust
est sto immigscalecont

esttab simple immigscale immigscalecont using TableF2, replace tab label wrap varwidth(25) cells("b(star fmt(2)) se(fmt(2) par)") onecell star(* .1 ** .05 *** .01) scalars("N Observations" "r2_p Pseudo R squared") title(Table F.2. Logit Models of the Assumption that the Described Policy will Benefit Immigrants and Not Native-Born Americans, with Interaction Terms and Controls (Mechanical Turk Follow-Up Study)) nobaselevels eqlabels(none) interaction(" X ") substitute(=1 "" "X Anti-immigration scale" "X Anti-immigration") order(2.treatgroup 3.treatgroup immigscale 2.treatgroup#c.immigscale 3.treatgroup#c.immigscale) nomtitles collabels(none) addnotes("Robust standard errors in parentheses" "* p<0.1, ** p<0.05, *** p<.01") nolz

*Table F.3 - Assumption Models with Alternative Immigration Negativity Measure
logit benefit_immigonly i.treatgroup, robust
est sto simple
logit benefit_immigonly i.treatgroup##c.immigneg, robust
est sto immigneg
logit benefit_immigonly i.treatgroup##c.immigneg $controls, robust
est sto immignegcont

esttab simple immigneg immignegcont using TableF3, replace tab label wrap varwidth(25) cells("b(star fmt(2)) se(fmt(2) par)") onecell star(* .1 ** .05 *** .01) scalars("N Observations" "r2_p Pseudo R squared") title(Table F.3. Logit Models of the Assumption that the Described Policy will Benefit Immigrants and Not Native-Born Americans using Alternative Measure of Anti-Immigration Sentiment, with Interaction Terms and Controls (Mechanical Turk Follow-Up Study)) nobaselevels eqlabels(none) interaction(" X ") substitute(=1 "" "Negative feelings towards immigrants" "Negativity to immigrants") order(2.treatgroup 3.treatgroup immigneg 2.treatgroup#c.immigneg 3.treatgroup#c.immigneg) nomtitles collabels(none) addnotes("Robust standard errors in parentheses" "* p<0.1, ** p<0.05, *** p<.01") nolz

//Table F.4 - Replication of Approval Results
reg approval i.benefit_immigonly##c.immigscale i.treatgroup, robust
est sto approval_nocont
reg approval i.benefit_immigonly##c.immigscale i.treatgroup ideo01 sr2k, robust
est sto approval_ideosr
reg approval i.benefit_immigonly##c.immigscale i.treatgroup $controls, robust 
est sto approval_cont
reg approval i.benefit_bornus##c.immigscale i.benefit_immig i.benefit_immig#c.immigscale i.treatgroup, robust 
est sto approval_sepintnc
reg approval i.benefit_bornus##c.immigscale i.benefit_immig i.benefit_immig#c.immigscale i.treatgroup $controls, robust 
est sto approval_sepint

esttab approval_nocont approval_ideosr approval_cont approval_sepintnc approval_sepint using TableF4, replace tab label wrap varwidth(25) b(%12.2g) se(%12.2g) star(* 0.1 ** 0.05 *** .01) scalars("N Observations" "r2 R squared") title(Table F.4. Linear Regression Models of Policy Approval, with Interaction Terms and Robust Standard Errors (Mechanical Turk Follow-Up Study)) nobaselevels eqlabels(none) interaction(" X ") substitute(=1 "" "Anti-immigration scale" "Anti-immigration") order(1.benefit_immigonly immigscale 1.benefit_immigonly#c.immigscale 1.benefit_immig 1.benefit_immig#c.immigscale 1.benefit_bornus 1.benefit_bornus#c.immigscale 2.treatgroup 3.treatgroup ideo01 sr2k) indicate(Controls = black hispanic otherrace male pid7 agecat incomecat educ notbornus parents_notbornus) nomtitles nolz

//Table F.5 - Approval Models with Alternative Immigration Negativity Measure
reg approval i.benefit_immigonly##c.immigneg i.treatgroup, robust
est sto neg_approval_nocont
reg approval i.benefit_immigonly##c.immigneg i.treatgroup ideo01 sr2k, robust
est sto neg_approval_ideosr
reg approval i.benefit_immigonly##c.immigneg i.treatgroup $controls, robust 
est sto neg_approval_cont
reg approval i.benefit_bornus##c.immigneg i.benefit_immig i.benefit_immig#c.immigneg i.treatgroup, robust 
est sto neg_approval_sepintnc
reg approval i.benefit_bornus##c.immigneg i.benefit_immig i.benefit_immig#c.immigneg i.treatgroup $controls, robust 
est sto neg_approval_sepint

esttab neg_approval_nocont neg_approval_ideosr neg_approval_cont neg_approval_sepintnc neg_approval_sepint using TableF5, replace tab label wrap varwidth(25) b(%12.2g) se(%12.2g) star(* 0.1 ** 0.05 *** .01) scalars("N Observations" "r2 R squared") title(Table F.5. Linear Regression Models of Policy Approval using Alternative Measure of Anti-Immigration Sentiment, with Interaction Terms and Robust Standard Errors (Mechanical Turk Follow-Up Study)) nobaselevels eqlabels(none) interaction(" X ") substitute(=1 "" "Negative feelings towards immigrants" "Negativity to immigrants") order(1.benefit_immigonly immigneg 1.benefit_immigonly#c.immigneg 1.benefit_immig 1.benefit_immig#c.immigneg 1.benefit_bornus 1.benefit_bornus#c.immigneg 2.treatgroup 3.treatgroup ideo01 sr2k) indicate(Controls = black hispanic otherrace male pid7 agecat incomecat educ notbornus parents_notbornus) nomtitles nolz

log close
exit
